<template>
	<view class="aft-box">
		<view class="item-list" v-for="item in list" :key="item.id" @tap="goUrl(item)">
			<view class="item">
				<text class="l">订单编号</text>
				<text class="val">{{item.orderId}}</text>
			</view>
			<view class="item">
				<text class="l">是否申请退款</text>
				<text class="val">{{item.refundType ==1?'是':'否'}}</text>
			</view>
			<view class="item">
				<text class="l">状态</text>error-color
				<text class="val" :class="{'success-color':item.questionStauts==4 || item.questionStauts==5 || item.questionStauts==6}">
					{{txt(item.questionStauts)}}
				</text>
			</view>
		</view>
		<empty @reload="getList" v-if="!list.length && show"/>
	</view>
</template>

<script>
	import {getQueryMyQuestion} from '@/api/aft.js'
	import empty from "@/components/empty.vue";
	export default {
		components:{
			empty
		},
		data() {
			return {
				list: [],
				show: false
			};
		},
		onLoad() {
			this.getList()
		},
		methods:{
			txt(num){
				let str
				if(num == 1) {
					str = '提交中'
				}
				if(num == 2) {
					str = '处理中'
				}
				if(num == 3) {
					str = '退款审核中'
				}
				if(num == 4) {
					str = '退款审核通过'
				}
				if(num == 5) {
					str = '退款完成'
				}
				if(num == 6) {
					str = '问题结案'
				}
				return str
			},
			goUrl(item){
				uni.navigateTo({
					url: '/pagesA/aftermarket/detail?id=' + item.id
				})
			},
			getList(){
				getQueryMyQuestion().then((res) => {
					this.list = res
					this.show = true
				})
			}
		}
	}
</script>

<style lang="less" scoped>
.aft-box{
	padding-top: 32rpx;
	.item-list{
		height: 264rpx;
		background: #FFFFFF;
		box-shadow: 0rpx 8rpx 20rpx 0rpx rgba(228,73,91,0.05);
		border-radius: 16rpx;
		margin: 0 32rpx;
		margin-bottom: 28rpx;
		.item{
			font-size: 28rpx;
			font-family: PingFangSC-Regular, PingFang SC;
			font-weight: 400;
			color: #666666;
			display: flex;
			margin: 0 30rpx;
			padding-top: 30rpx;
			.val{
				color: #666;
				flex: 1;
				text-align: right;
			}
		}
		.item:nth-child(2){
			padding-top: 50rpx;
			margin-bottom: 15rpx;
		}
	}
}
</style>
